const uuidV4 = require('uuid/v4');

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('cosmeticsDetail', {
    detail_id: {
      type: DataTypes.UUID,
      primaryKey: true,
      defaultValue: () => {
        return uuidV4()
      }
    },
    kw: {
      type: DataTypes.STRING,
      field: 'kw',
      allowNull: false
    },
    title: {
      type: DataTypes.STRING,
      field: 'title',
      allowNull: false
    },
    link: {
      type: DataTypes.STRING,
      field: 'link',
      allowNull: false
    },
    picture: {
      type: DataTypes.STRING,
      field: 'picture',
      allowNull: false
    },
    price: {
      type: DataTypes.STRING,
      field: 'price',
      allowNull: false
    },
    classify: {
      type: DataTypes.STRING,
      field: 'classify',
      allowNull: true
    },
    des: {
      type: DataTypes.STRING,
      field: 'des',
      allowNull: true
    }
  },
  {
    timestamps: false,
    tableName: 'cosmetics_detail'
  })
}
